﻿@model IEnumerable<Catalog>
@{
    ViewBag.Title = "管理后台";
}

<article class="article article-type-post" itemscope itemprop="blogPost">
    <div class="article-inner">
        <input type="hidden" class="isFancy" />
        <header class="article-header">
            <h1 itemprop="name">
                <a class="article-title" href="#">@ViewBag.Title</a>
            </h1>
        </header>
        <div class="article-entry" itemprop="articleBody">
            <p>
                <a yuuko-static href="javascript:$('#frmNewCatalog').submit();">新建分类</a>
            </p>
            <form asp-action="CatalogDelete" asp-controller="Admin" method="post" id="frmDeleteCatalog"></form>
            <form asp-action="CatalogEdit" asp-controller="Admin" method="post" id="frmEditCatalog"></form>
            <form asp-action="CatalogNew" asp-controller="Admin" method="post" id="frmNewCatalog"></form>
            <table class="table">
                <thead>
                    <tr>
                        <th>标题</th>
                        <th>英文标题</th>
                        <th>排序</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var x in Model)
                    {
                        <tr data-catalog="@x.Url">
                            <td class="display d-title-zh">@x.Title</td>
                            <td class="display d-title">@x.Url</td>
                            <td class="display d-order">@x.PRI</td>
                            <td class="editing"><input class="title-zh textbox" type="text" value="@x.Title" /></td>
                            <td class="editing"><input class="title textbox" type="text" value="@x.Url" /></td>
                            <td class="editing"><input class="order textbox" type="text" value="@x.PRI" /></td>
                            <td>
                                <a class="display" href="javascript:editCatalog('@x.Url');">编辑</a>
                                <a class="display" href="javascript:deleteCatalog('@x.Url');">删除</a>
                                <a class="editing" href="javascript:saveCatalog('@x.Url');">保存</a>
                                <a class="editing" href="javascript:cancelEditCatalog();">取消</a>
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</article>